<!DOCTYPE html>
<html>
<head>
	<title>餐饮营销支持系统</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	 <meta name = "viewport" content = "width = device-width, initial-scale = 1.0, maximum-scale = 1.0, user-scalable = 0" />
	<link href="../../css/bootstrap.min.css" rel="stylesheet">
	<link href="../../css/money.css" rel="stylesheet">
</head>
<body>
	<div id="head">
		<div class="navbar navbar-default  navbar-inverse" role="navigation">
			<div class="navbar-header">
				<a id="name" class="navbar-brand">姓名</a>
			</div>
			<button type="button" class="btn btn-danger">
				<span style="margin-right: 5px" class="glyphicon glyphicon-off"></span>注销
			</button>
		</div>
	</div>
	<div id="con">
		<div class="con-left">
			<p id="z1">总资产（￥）</p>
			<p id="money">538.25</p>
		</div>
		<div class="con-right">
			<span id="down" class="glyphicon glyphicon-circle-arrow-down pull-right">
			</div>
		</span>
	</div>
	<div id="conn">
		<div class="row">
			<div class="con-left">
				<span class="glyphicon glyphicon-plus-sign"></span>
			</div>
			<div class="con-right">
				<p class="ztitle"><span>哈尔滨店</span><span class="pull-right">+29.00</span></p>
				<p class="ztime">09-2716:02</p>
			</div>
		</div>
		<hr/>
		<div class="row">
			<div class="con-left">
				<span class="glyphicon glyphicon-minus-sign"></span>
			</div>
			<div class="con-right">
				<p class="ztitle"><span>提现</span><span class="pull-right">-39.00</span></p>
				<p class="ztime">09-2716:02</p>
			</div>
		</div>
	</div>
	<div id="bottom">
		<p>Copyright © 2017 xingli.com</p>
	</div>
	<script src="../../js/Jquary/jquery-3.2.1.min.js"></script>
	<script src="../../js/Jquary/jquery.easyui.min.js"></script>
	<script src="../../js/bootstrap.min.js"></script> 
	<script src="../../js/money.js"></script> 
	<script type="text/javascript">
		$(document).ready(function(){
			$("#down").click(function(){
				alert("转账");
			})
			getMyAccount();
		})
	</script>
	<script type="text/javascript">
		function getMyAccount(){
			$.ajax({
				type:"get",
				url:"/ldss/customers/myaccount",
				async:false,
				dataType:"json",
				success: function (data) {
					if(data.success){
						var data = data.data;
						$("#money").empty();
						$("#money").append(data.mycapital)
						var profit_data = data.profits;
						$("#conn").empty();
						if(profit_data.length>0){
							for(var i = 0; i < profit_data.length; i++){
								if(profit_data.flag==1){
									$("#conn").append(
									"<div class='row'>"+
										"<div class='con-left'>"+
											"<span class='glyphicon glyphicon-plus-sign'></span>"+
										"</div>"+
										"<div class='con-right'>"+
											"<p class='ztitle'><span>"+profit_data.storename+"</span><span class='pull-right'>+"+profit_data.profitamount+"</span></p>"+
											"<p class='ztime'>"+profit_data.profitdate+"</p>"+
										"</div>"+
									"</div>"
									);
								}else{
									$("#conn").append(
									"<div class='row'>"+
										"<div class='con-left'>"+
											"<span class='glyphicon glyphicon-plus-sign'></span>"+
										"</div>"+
										"<div class='con-right'>"+
											"<p class='ztitle'><span>提现</span><span class='pull-right'>"+profit_data.profitamount+"</span></p>"+
											"<p class='ztime'>"+profit_data.profitdate+"</p>"+
										"</div>"+
									"</div>"
									);
								}
							}
							$(this).removeClass("list-group-item-danger");
						}
					}else{
						alert(data.message);
					}
				}
			});
		}
	</script>
</body>
</html>